import { http } from "@/utils/http";
import type { AxiosResultDefault } from "../type";

type ResultTable = {
  total?: number;
  data?: Array<any>;
};

// 能源一览表-查询
export const getData = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/report/viewInventory`, {
    data
  });
};

// 能源一览表-更新
export const updateData = (data?: object | undefined) =>
  http.request<AxiosResultDefault>("post", `/energy/report/updateInventory`, { data }, { headers: { noLoading: true } });

// 能源一览表-导出
export const exportExcel = (data?: object | undefined) =>
  http.request<AxiosResultDefault>("post", `/energy/report/exportInventory`, { data }, { headers: { noLoading: true } });
